#include "dialog.h"
#include "ui_dialog.h"

Dialog::Dialog(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);

    edit_row=new QLineEdit(this);
    edit_col=new QLineEdit(this);
    edit_kun=new QLineEdit(this);

    lable_row=new QLabel("行数",this);
    lable_col=new QLabel("列数",this);
    lable_kun=new QLabel("坤数",this);

    edit_row->move(150,30);
    edit_col->move(150,70);
    edit_kun->move(150,110);

    lable_row->move(100,30);
    lable_col->move(100,70);
    lable_kun->move(100,110);

    up=new QPushButton("确定",this);
    up->move(150,150);

    connect(up,SIGNAL(clicked()),this,SLOT(up_all()));
}

void Dialog::setRows(int rows)
{
    this->rows=rows;
}
void Dialog::setCols(int cols)
{
    this->cols=cols;
}
void Dialog::setKun(int kun)
{
    this->kun=kun;
}
int Dialog::getRows()
{
    return rows;
}
int Dialog::getCols()
{
    return cols;
}
int Dialog::getKun()
{
    return kun;
}
void Dialog::up_all()
{
    rows=edit_row->text().toInt();
    cols=edit_col->text().toInt();
    kun=edit_kun->text().toInt();

    emit(dia_test());
    this->close();
}


Dialog::~Dialog()
{
    delete ui;
}
